#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More tests => 5;

# include below in  all tests for clean env

BEGIN { use_ok('Test::WWW::Mechanize::Catalyst', 'WIAB');
        use_ok('Catalyst::Test', 'WIAB');
        use FindBin;
        require "$FindBin::Bin/bin/make_test_env.pl";

    }

END { require FindBin;
      require "$FindBin::Bin/bin/remove_test_env.pl"
  }


my $mech = Test::WWW::Mechanize::Catalyst->new();
$mech->get_ok('http://localhost', 'got front page ok');
$mech->content_contains ('This is the home page', 'home page got');
my ($server, $path, $req);
if ($ENV{CATALYST_SERVER}) {
    $req = $ENV{CATALYST_SERVER} . '/content';
}
else { $req = 'http://localhost/content'}
is ($mech->uri, $req, 'redirected uri as expected');





